#ifndef MJPEG_STREAM_SERVER_H
#define MJPEG_STREAM_SERVER_H

#include "pusher/http_stream_server.hpp"
#include "buffer/shared_frame_buffer.hpp"
#include <memory>
#include <iostream>

class MJPEGStreamServer : public HttpStreamServer {
public:
    // using FrameProvider = std::function<bool(std::vector<uint8_t> &)>;
    MJPEGStreamServer(int port, std::shared_ptr<SharedFrameBuffer> buffer)
    : HttpStreamServer(port), _buffer(buffer) {
        std::cout << "MJPEGStreamServer 构造函数被调用" << std::endl;
    }


protected:
    void HandleClient(int client_fd) override;

private:
    std::shared_ptr<SharedFrameBuffer> _buffer;  // 直接保存 buffer 指针
};


#endif /* MJPEG_STREAM_SERVER_H */